As the value and use of information continues to increase, individuals and businesses seek additional ways to process and store information. One option available to these users is an information handling system. An information handling system generally processes, compiles, stores, and/or communicates information or data for business, personal, or other purposes thereby allowing users to take advantage of the value of the information. Because technology and information handling needs and requirements vary between different users or applications, information handling systems may vary with respect to the type of information handled; the methods for handling the information; the methods for processing, storing or communicating the information; the amount of information processed, stored, or communicated; and the speed and efficiency with which the information is processed, stored, or communicated. The variations in information handling systems allow for information handling systems to be general or configured for a specific user or specific use such as financial transaction processing, airline reservations, enterprise data storage, or global communications. In addition, information handling systems may include or comprise a variety of hardware and software components that may be configured to process, store, and communicate information and may include one or more computer systems, data storage systems, and networking systems.
Information handling systems including computer systems often incorporate real-time clocks to keep track of the current time even if the computer system is not powered on. These real-time clocks operate on batteries that are disconnected from the power supply used to operate the information handling system. Real-time clocks (RTCs) are often located on the motherboard, in Complementary Metal-Oxide Semiconductor (CMOS) integrated circuit chips such as the Southbridge, along with a few registers to program the RTC chip and a small amount of local memory. The registers can typically be divided into three groups: clock/calendar registers, status registers, and CMOS configuration data registers.
The RTC chip can be directly accessed through input/output (I/O) ports by software running on a computer system trying to manage events that need to be calibrated to real time. For example, certain operating systems, including the Microsoft Windows operating system, rely on interrupts generated by the RTC chip to maintain a computer system's system clock and to aid in scheduling tasks among system resources with a scheduler. In particular, the scheduler software component of an operating system will rely on interrupts generated by the RTC chip to function. An RTC chip will typically have an interrupt pin connected to a dedicated Interrupt Request (IRQ) input line, the IRQ8 line, on a Advanced Programmable Interrupt Controller (APIC), which prioritizes and feeds interrupts to the processor(s) of a computer system. The RTC chip can be used to generate periodic interrupts, as well as to generate interrupts at specific times and after each clock update. For periodic interrupts in particular, an operating system may be designed to be interrupted at a short regular interval. For example, certain operating systems are designed to be interrupted approximately every 15.625 milliseconds. In such a situation, the RTC chip will interrupt the processor via the IRQ8 line to the APIC approximately every 15.625 milliseconds. The IRQ8 interrupt will be serviced by a RTC interrupt handler or interrupt service routine in the operating system. The RTC interrupt handler (or operating system interrupt service routine) will execute the code necessary to manage the interrupt and clear all interrupt flags from one of the status registers for the RTC, RTC Status Register C. Clearing these interrupt flags allows future RTC periodic interrupts to take place: the RTC chip will not generate future RTC periodic interrupts unless RTC Status Register C has been read.
Again, one example of software that relies on interrupts generated by the RTC chip is an operating system scheduler. An operating system scheduler ideally is responsible for assigning priority levels to the various processes the operating system is trying to manage and for balancing processor loads in multi-processor computer systems. The health of the entire information system depends on the proper operation of the operating system scheduler. In multi-processor systems, an operating system typically provides a way to ensure that when one processor accesses an indexed I/O pair, such as CMOS 70h/71h, the I/O operation is not interrupted by other processors. The operating system spin-lock protected kernel I/O access service routine provides one way to protect against interruption. If a CMOS driver bypasses the kernel's spin-lock protected I/O call to directly access the CMOS register, however, the CMOS driver could interfere with the operating system's handling of RTC interrupts. That is, if the CMOS driver bypasses the kernel's spin-lock protected I/O call while the operating system is reading RTC Status Register C, the operating system might inadvertently read the wrong CMOS register instead. As a result, Status Register C would be left unread, and the RTC could not generate future RTC periodic interrupts. Because the operating system scheduler relies on the periodic RTC interrupts to function, the operating system will fail, bringing the computer system to a halt.
Another problem may arise because of the ability for user software to access the RTC registers: the user software may alter the registries and corrupt them. Corruption of the RTC registers can lead to system failures as well. For both of these problems, the most vulnerable RTC registers are at the Status Register A and Status Register C, also referred to as index offsets 0Ah and 0Ch. Status Register A and Status Register C directly affect the operation of the RTC chip.
One way to recover from these problems is for the operating system to use a “watchdog timer” inside its RTC interrupt handler. This watchdog timer is reset to a preset value just before an interrupt exits the RTC interrupt handler. If an RTC interrupt does not happen while the watchdog timer is running, an RTC watchdog timeout interrupt handler will check the RTC status registers and take any necessary corrective actions to restart the RTC periodic interrupts. This approach suffers from the drawbacks: it requires a dedicated hardware watchdog timer, and CMOS drivers can still interfere with operating system's handling of RTC interrupts even if this dedicated hardware watchdog timer is present.